﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace FD.RemoteAssistant.JsonEx
{
    /*
     * CreatedOn: 2018-05-15
     * CreatedBy: Jackie Lee(天宇遊龍)
     */
    public static class ObjExtensions
    {
        public static string ToJson(this object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public static T FromJson<T>(this string str)
        {
            return JsonConvert.DeserializeObject<T>(str);
        }
    }
}
